Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Frax middleman example #41

Merged
merged 8 commits into from
Jan 31, 2024
Merged

feat: Frax middleman example #41

merged 8 commits into from
Jan 31, 2024

Conversation

sogipec
Copy link
Contributor

@sogipec sogipec commented Oct 26, 2023

No description provided.

contracts/middleman/MerklFraxIncentivizationHandler.sol Dismissed Show dismissed Hide dismissed
contracts/middleman/MerklFraxIncentivizationHandler.sol Dismissed Show dismissed Hide dismissed
}

/// @notice Sets the operator of the contract
function setOperator(address _operatorAddress) external onlyByOwnerOperator {

Check notice

Code scanning / Slither

Missing zero address validation Low

Comment on lines 82 to 110
function incentivizePool(
address poolAddress,
address,
address,
address incentiveTokenAddress,
uint256,
uint256 amount
) external {
IERC20(incentiveTokenAddress).safeTransferFrom(msg.sender, address(this), amount);
DistributionParameters memory params = gaugeParams[poolAddress][incentiveTokenAddress];
if (params.uniV3Pool == address(0)) revert InvalidParams();
DistributionCreator creator = merklDistributionCreator();
// Minimum amount of incentive tokens to be distributed per hour
uint256 minAmount = creator.rewardTokenMinAmounts(incentiveTokenAddress) * params.numEpoch;
params.epochStart = uint32(block.timestamp);
// Adding the leftover amounts to the total amount to be distributed
uint256 leftover = leftovers[incentiveTokenAddress][poolAddress];
amount += leftover;
params.amount = amount;
if (amount > 0) {
if (amount > minAmount) {
_handleIncentiveTokenAllowance(IERC20(incentiveTokenAddress), address(creator), amount);
merklDistributionCreator().createDistribution(params);
if (leftover > 0) leftovers[incentiveTokenAddress][poolAddress] = 0;
} else {
leftovers[incentiveTokenAddress][poolAddress] = amount;
}
}
}
@sogipec sogipec force-pushed the frax-incentivizor-handler branch from ebcf76c to ce72f26 Compare January 12, 2024 11:52
@sogipec sogipec enabled auto-merge (squash) January 31, 2024 14:26
@sogipec sogipec merged commit e7e7e2d into main Jan 31, 2024
4 checks passed
@sogipec sogipec deleted the frax-incentivizor-handler branch January 31, 2024 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants